package cn.tedu.truetaste.pojo.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 菜品数据的实体类
 *
 * @author java@tedu.cn
 * @version 0.0.1
 */
@Document(indexName = "zpw_dc")
@ApiModel(value="对应搜索的文档entity")
@Data
public class DishesForElastic implements Serializable {
    /**
     * 数据id
     */
    @Id
    @ApiModelProperty(value="数据id")
    private Long id;
    /**
     * 菜品名称
     */
    @Field(name="name",type = FieldType.Text,
            analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value="菜品名称")
    private String name;
    /**
     * 菜品分类名称
     */
    @Field(name="category",type = FieldType.Text,
            analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value="菜品分类名称")
    private String category;
    /**
     * 菜品图片
     */
    @Field(name = "url")
    @ApiModelProperty(value = "菜品图片")
    private String url;
    /**
     * 菜品简介
     */
    @Field(name = "description")
    @ApiModelProperty(value = "菜品简介")
    private String description;
    /**
     * 菜品价格
     */
    @Field(name = "price")
    @ApiModelProperty(value = "菜品价格")
    private Double price;
    /**
     * 库存
     */
    @Field(name = "inventory")
    @ApiModelProperty(value = "库存")
    private Integer inventory;
    /**
     * 会员价
     */
    @Field(name = "VIP")
    @ApiModelProperty(value = "会员价")
    private Double VIP;
    /**
     * 菜品分类id
     */
    @Field(name = "categoryId")
    @ApiModelProperty(value = "菜品分类id")
    private Long categoryId;
    /**
     * 菜品排序序号
     */
    @Field(name = "sort")
    @ApiModelProperty(value = "菜品排序序号")
    private Integer sort;


}
